gdk: deal with GDK_SMOOTH_SCROLL events as not having a direction
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 23 Jan 2012 22:51:24 +0000 (23:51 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 1 Mar 2012 21:28:57 +0000 (16:28 -0500)
gdk_event_get_scroll_direction() will return FALSE on these, so
gdk_event_get_scroll_deltas() has to be used to retrieve dx/dy

gdk/gdkevents.c

index 7abd956c2f65fc2ba12dc777d79d9fdb0200cfcf..db37512bc601c51c9a1cfa473e88d479ff00eb5f 100644 (file)
@@ -1196,7 +1196,10 @@ gdk_event_get_scroll_direction (const GdkEvent *event,
   switch (event->type)
     {
     case GDK_SCROLL:
-      dir = event->scroll.direction;
+      if (event->scroll.direction == GDK_SCROLL_SMOOTH)
+        fetched = FALSE;
+      else
+        dir = event->scroll.direction;
       break;
     default:
       fetched = FALSE;